package com.my.study.zookeeper_study;

import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.ZooKeeper;

import java.util.concurrent.CountDownLatch;

public class ZKDistributeLock {


    private static CountDownLatch countDownLatch = new CountDownLatch(1);
    public static void main(String[] args) {

        try {
            String connectStr = "127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183";
            int sessionTimeOut = 5000;
            ZooKeeper zooKeeper = new ZooKeeper(connectStr, sessionTimeOut, new MyZookeeperStudy());



        }catch (Exception e){
            e.printStackTrace();
        }
        System.out.println("zookeeper--------");
    }


}
